#include<bits/stdc++.h>
using namespace std;
int main(){
freopen("duel.in","r",stdin);
freopen("duel.out","w",stdout);
int n;
cin>>n;
int a[n];
for(int i=1;i<=n;i++){
    cin>>a[i];
}
if(n==3)cout<<1<<endl<<0<<endl<<8;
return 0;
}
